package com.shuziren.controller.digitaladmin;

import com.shuziren.entity.InterviewStatistics;
import com.shuziren.service.InterviewStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/interview-statistics")
public class InterviewStatisticsController {

    @Autowired
    private InterviewStatisticsService interviewStatisticsService;

    /**
     * 获取所有面试统计信息
     * @return 面试统计信息列表
     */
    @GetMapping
    public List<InterviewStatistics> getAllInterviewStatistics() {
        return interviewStatisticsService.findAll();
    }

    /**
     * 根据ID获取面试统计信息
     * @param id 面试统计信息ID
     * @return 对应的面试统计信息
     */
    @GetMapping("/{id}")
    public InterviewStatistics getInterviewStatisticsById(@PathVariable Long id) {
        return interviewStatisticsService.findById(id);
    }

    /**
     * 根据ID删除面试统计信息
     * @param id 面试统计信息ID
     */
    @DeleteMapping("/{id}")
    public void deleteInterviewStatistics(@PathVariable Long id) {
        interviewStatisticsService.deleteById(id);
    }
}